package com.itheima.zhuanhuan;

import java.io.*;
import java.nio.charset.Charset;

/*
复制文本文件   小说
11mb   gbk
使用数组优化

 */
public class Test04 {

    public static void main(String[] args) throws IOException {

        //创建输入流
        BufferedReader reader = new BufferedReader(new FileReader("E:\\31期就业班\\se_加强\\day08_集合01\\补充作业.txt"));    //创建输出流
        BufferedWriter writer = new BufferedWriter(new FileWriter("day13\\copy\\aaaa.txt"));
        //边读别写
        long start = System.currentTimeMillis();
     char[] chars=new char[1024];
     int len;
     while ((len=reader.read(chars))!=-1){
         writer.write(chars,0,len);
     }
        long end = System.currentTimeMillis();
        System.out.println(end-start);//180


        //各自释放资源
        reader.close();
        writer.close();

    }

}
